﻿<UserControl x:Class="NicoView.View.NicoViewCommentArtWriteControl"
             x:Name="CommentArtEditControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             DataContext="{Binding NicoCommentEditorViewModel,Mode=OneWay,Source={StaticResource locator}}"
             d:DesignHeight="300" d:DesignWidth="300" Loaded="CommentArtEditControl_Loaded">
    <UserControl.Resources>
        <ResourceDictionary Source="Dictionary/CommentEditorDictionary.xaml"/>

    </UserControl.Resources>
    
    <Grid>
        
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>

        <TextBox ScrollViewer.VerticalScrollBarVisibility="Auto" Style="{DynamicResource CommentEditTextStyle}" Grid.Column="0" UndoLimit="1024" x:Name="EditText" Margin="2" AcceptsReturn="True"   />
        
        <Grid Grid.Column="1" Margin="2" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="5"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid Grid.Row="0" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="5"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="5"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="5"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="5"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Label Grid.Row="0" Grid.Column="0" Content="{Binding CommentColor, Mode=OneWay, Source={StaticResource resources}}" />
                <ComboBox Grid.Row="0"  Grid.Column="2" x:Name="CommentColorSelection"  ItemsSource="{Binding CommentColors}" SelectedItem="{Binding CurrentCommentColor,Mode=TwoWay}" >
                    <ComboBox.ItemTemplate>
                        <DataTemplate>

                            <Border VerticalAlignment="Center" HorizontalAlignment="Center" Background ="{Binding Brush}" BorderBrush="Black" BorderThickness="1" ToolTip="{Binding Description}"  Width="12" Height="12" />


                        </DataTemplate>
                    </ComboBox.ItemTemplate>
                    
                </ComboBox>


                <Label Grid.Row="2"  Content="{Binding CommentPosition, Mode=OneWay, Source={StaticResource resources}}" />
                <ComboBox Grid.Row="2"   Grid.Column="2" x:Name="CommentPositionSelection"  ItemsSource="{Binding CommentPositions}" SelectedItem="{Binding CurrentPosition}" >
                    <ComboBox.ItemTemplate>
                        <DataTemplate>

                            <Label Content="{Binding Name}" ToolTip="{Binding Description}" />


                        </DataTemplate>
                    </ComboBox.ItemTemplate>

                </ComboBox>

                <Label Grid.Row="4"  Content="{Binding CommentSize, Mode=OneWay, Source={StaticResource resources}}" />
                <ComboBox Grid.Row="4"   Grid.Column="2" x:Name="CommentSizeSelection"  ItemsSource="{Binding CommentSizings}" SelectedItem="{Binding CurrentSize}" >
                    <ComboBox.ItemTemplate>
                        <DataTemplate>

                            <Label Content="{Binding Name}" ToolTip="{Binding Description}" />


                        </DataTemplate>
                    </ComboBox.ItemTemplate>

                </ComboBox>

                <ToggleButton Grid.Row="6" Style="{DynamicResource AnonymousButtonStyle}"  Grid.Column="0" x:Name="AnonymousButton" Content="184" IsChecked="{Binding AnonymousSend}"  Margin="2" DataContext="{Binding SettingConsoleViewModel, Mode=OneWay, Source={StaticResource locator}}"  />
                <ToggleButton Grid.Row="6" Style="{DynamicResource OwnerButtonStyle}" Grid.Column="2" x:Name="OwnerButton" Content="運営コメ" IsChecked="{Binding OwnerSend}" Margin="2" DataContext="{Binding SettingConsoleViewModel, Mode=OneWay, Source={StaticResource locator}}" />


            </Grid>
            
            <Button Grid.Row="3" x:Name="CommentSubmitButton" Grid.Column="4" Margin="2" Content="送信" Command="{Binding CommentWriteExecuteCommand, Mode=OneWay}" CommandParameter="{Binding Text, ElementName=EditText}" />
            
        </Grid>
    </Grid>
    
</UserControl>
